<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
 
    <style>
        * {
            margin: 0;
            padding: 0;
        }
         
        html {
            height: 100%;
            width: 100%;
            overflow: hidden;
            margin: 0;
            padding: 0;
            background: url(4.jpg) no-repeat 0px 0px;
            background-repeat: no-repeat;
            background-size: 100% 100%;
            -moz-background-size: 100% 100%;
        }
         
        body {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
        }
         
        #loginDiv {
            width: 37%;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 300px;
            background-color: rgba(75, 81, 95, 0.3);
            box-shadow: 7px 7px 17px rgba(130, 132, 136, 0.5);
            border-radius: 1000px;
            animation:turn 1s linear;
        }
 
        @keyframes turn{
            0%{-webkit-transform:perspective(400px) rotateY(180deg);} 
            100%{-webkit-transform:perspective(400px) rotateY(0deg);} 
        }
         
        #name_trip {
            margin-left: 50px;
            color: red;
        }
         
        p {
            margin-top: 30px;
            margin-left: 20px;
            color: azure;
        }
         
        input {
            margin-left: 15px;
            border-radius: 5px;
            border-style: hidden;
            height: 30px;
            width: 140px;
            background-color: rgba(216, 191, 216, 0.5);
            outline: none;
            color: #f0edf3;
            padding-left: 10px;
        }
         
        .button {
            border-color: cornsilk;
            background-color: rgba(100, 149, 237, .7);
            color: aliceblue;
            border-style: hidden;
            border-radius: 5px;
            width: 100px;
            height: 31px;
            font-size: 16px;
        }
    </style>
</head>
<body>
 
    <div id="loginDiv">
        <form action="#" id="form">
            <h1 style="text-align: center;color: aliceblue;">立即登录</h1>
            <p>&nbsp;&nbsp;&nbsp;邮箱:&nbsp;&nbsp;&nbsp;&nbsp;<input id="email" type="text"><label id="name_trip"></label></p>
 
            <p>密码:<input id="password" type="password"><label id="password_trip"></label></p>
 
            <div style="text-align: center;margin-top: 30px;">
                <input type="submit" class="button" value="登录" onclick="check()">
                <input type="button" class="button" onclick='location.href=("注册界面.html")' value="注册">
            </div>
        </form>
    </div>
    
</body>
 
    <script>
 
        function check() {
            var inputEmail = document.getElementById("email");
            // 获取输入内容
            var uEmail = inputEmail.value;
            // 检测邮箱格式
            if (!/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(uEmail)) {
                alert("邮箱不合法");
                return false;
            }
 
            //获取用户名输入项
            var userNname = document.getElementById("password");
            var uName = userNname.value;
            if (uName.length < 6 || uName.length >= 15) {
                alert("账号长度需要大于6位小于15位");
                return false;
            }
            window.open("效果展示.html");
        }
 
    </script>
</html>